# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-portend
pkgver=3.2.0
pkgrel=1
pkgdesc="TCP port monitoring and discovery"
url="https://github.com/jaraco/portend"
arch="noarch"
license="MIT"
depends="py3-tempora"
# py3-setuptools_scm is required to set version of python module
makedepends="
	py3-setuptools
	py3-setuptools_scm
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-freezegun
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/p/portend/portend-$pkgver.tar.gz"
builddir="$srcdir/portend-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
56790cdb6d1619e8873acc2498f9bee758a64ad8f8e47f31e48ae1ac7b6f038fc81af5d52cbc4bc4797dd6dc25d453d391d73d454c98559b1d6a8e9061837d7f  portend-3.2.0.tar.gz
"
